package com.example.common.base;

import android.os.Bundle;

import androidx.annotation.Nullable;


import com.example.common.CommonPresenter;
import com.example.common.ICommonModel;
import com.example.common.ICommonView;


public abstract class BaseMvpActivity<M extends ICommonModel> extends BaseActivity implements ICommonView {
    private M m;
    public CommonPresenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayoutId());
        m = setModel();
        presenter = new CommonPresenter(this, m);
        setUpView();
        setUpData();
    }

    public abstract int setLayoutId();

    public abstract void setUpView();

    public abstract void setUpData();

    public abstract M setModel();
}
